﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace csv2json.convert.objConverter
{
    public class PenguinConverter : BaseConverter
    {
        public PenguinConverter(String path) : base(path)
        {
            root = "'Pen-root$'";

            RelatedPath.Add("root", "'Pen-root$'");
            RelatedPath.Add("entity", "'Pen-info$'");
            RelatedPath.Add("exp_tree", "'Pen-exptree$'");
            RelatedPath.Add("levels", "'Pen-levels$'");
            RelatedPath.Add("0", "'Pen-level-detail$'");
            RelatedPath.Add("1", "'Pen-level-detail$'");
            RelatedPath.Add("2", "'Pen-level-detail$'");
            RelatedPath.Add("3", "'Pen-level-detail$'");
            RelatedPath.Add("4", "'Pen-level-detail$'");
            RelatedPath.Add("5", "'Pen-level-detail$'");
            RelatedPath.Add("6", "'Pen-level-detail$'");
            RelatedPath.Add("7", "'Pen-level-detail$'");
            RelatedPath.Add("8", "'Pen-level-detail$'");
            RelatedPath.Add("9", "'Pen-level-detail$'");
            RelatedPath.Add("10", "'Pen-level-detail$'");
            RelatedPath.Add("sell", "'Pen-sell$'");
            RelatedPath.Add("eat", "'Pen-eat$'");
            RelatedPath.Add("buy_exp", "'Pen-buy$'");
        }

        public String convert()
        {
            String result = base.convert();

            result = result.Replace("root", "penguins");

            for (int i = 0; i <= 10; ++i)
            {
                result = result.Replace("lv"+i, Convert.ToString(i));
            }

            result = "{\n" + result + "\n}";

            return result;
        }
    }
}
